import { defineStore } from 'pinia'
import { ref } from 'vue'
export const usePopStore = defineStore('pop', () => {
  //空域属性信息
  const Airspace = ref({
    showPop: false,
    popInfo: null
  })
  //起降点信息
  const RiseLand = ref({
    showPop: false,
    popInfo: null
  })
  //通导监属性信息
  const Equipment = ref({
    showPop: false,
    popInfo: null
  })
  //机库信息
  const Jc = ref({
    showPop: false,
    popInfo: null
  })
  //航线信息
  const Hangxian = ref({
    showPop: false,
    popInfo: null
  })
  //雷达监测信息
  const Radar = ref({
    showPop: false,
    popInfo: null
  })
  //气象监测信息
  const Qx = ref({
    showPop: false,
    popInfo: null
  })

  //风场色带
  const showColorBar = ref(false)

  //记录鼠标点击位置
  const XY = ref([0, 0])

  const closeAllPop = () => {
    Airspace.value.showPop = false
    RiseLand.value.showPop = false
    Equipment.value.showPop = false
    Jc.value.showPop = false
    Hangxian.value.showPop = false
    Radar.value.showPop = false
    Qx.value.showPop = false
    showColorBar.value = false
  }
  return { Airspace, RiseLand, Equipment, Jc, Hangxian, Radar, Qx, XY, showColorBar, closeAllPop }
})
